import request from "@/utils/request";
import { downLoadAll } from "@/utils/zipdownload";
// 获取详细信息
export function getOrderList(data) {
  return request({
    url: "/order/info/list",
    method: "get",
    params: data
  });
}

// 订单明细 - 获取订单明细信息
export function getDetailList(data) {
  return request({
    url: "/order/detail/list",
    method: "get",
    params: data
  });
}

// 快速分配-获取快速分配人员信息
export function getFastDealUser(orderId) {
  return request({
    url: "/oper/userValid/getFastDealUser",
    method: "get",
    params: orderId
  });
}

// 订单明细 - 重命名订单明细
export function updateGroupName(data) {
  return request({
    url: "order/detail/updateGroupName",
    method: "put",
    data: data
  });
}

// 分配订单负责人
export function updateManager(data) {
  return request({
    url: "order/info/updateManager",
    method: "put",
    data: data
  });
}

// 分配负责人-判断是否有实施人员
export function validOperUser(data) {
  return request({
    url: "order/info/validOperUser",
    method: "get",
    params: data
  });
}

// 快速分配 - 提交
export function fastDeal(data) {
  return request({
    url: "/oper/userValid/fastDeal",
    method: "post",
    params: data
  });
}

// 精确分配 - 授权量
export function getAvailableNum(data) {
  return request({
    url: "/oper/detailValid/getAvailableNum",
    method: "get",
    params: data
  });
}

// 请确分配- 个人授权数量校验
export function validPersonalNum(data) {
  return request({
    url: "/oper/userValid/validPersonalNum",
    method: "get",
    params: data
  });
}

// 精确分配 - 提交
export function exactDeal(data) {
  return request({
    url: "/oper/userValid/exactDeal",
    method: "post",
    params: data
  });
}

export function downloadAuthFile(id) {
  var url = "/record/execute/downloadLicence/" + id;
  return downLoadAll(url);
}

// 精确分配实施人员回显
export function getExactDealUser(data) {
  return request({
    url: "/oper/userValid/getExactDealUser",
    method: "get",
    params: data
  });
}
